#include<iostream>  
using namespace std;
int main() {
	int n;
	cin >> n;
	while (n--) {
		int a, i;
		cin >> a;		for (i = 1; i <= a; ++i)
			if (i &1)
				cout << i << " ";
		cout << endl;
		for (i = 1; i <= a; ++i)
			if (i & 1)
				continue;
			else
				cout << i << " ";
		cout << endl << endl;
	}
	return 0;
}
